<template>
  <div style="padding:20px">
    <div>
      <div class="title">QuillEditor</div>
      <div class="btns">
        <el-button type="primary" @click="cleanQuill()">清空</el-button>
      </div>
      <div>
        <QuillEditorComponents ref="QuillEditor" :header="header" :serverUrl="serverUrl" v-model="content"></QuillEditorComponents>
      </div>
    </div>
  </div>
</template>

<script>
// 注意这边的路径，按照自己项目引入的实际路径引入即可
import QuillEditorComponents from '@/components/QuillEditorComponents'
export default {
  components: {
    QuillEditorComponents
  },
  data () {
    return {
      content: '测试',// 富文本绑定的参数
      serverUrl:'',//图片上传的服务器地址,不传则默认用base64
      header:{},//图片上传的自定义头部
    }
  },
  methods: {
    cleanQuill(){
      this.$refs.QuillEditor.clearText()
      this.content = 'lala'
    }
  }
}
</script>
<style scoped lang="scss">
.title{
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin: 20px;
}
</style>